import { Component, OnInit } from '@angular/core';
import * as constants from '../../../providers/Constants'
import { ToastService } from './../../../providers/toast/toast.service'
import { AuthService } from 'src/app/services/auth.service';

@Component({
  selector: 'app-company-profile',
  templateUrl: './company-profile.page.html',
  styleUrls: ['./company-profile.page.scss'],
})
export class CompanyProfilePage implements OnInit {
  companyProfile:string=''
  constructor(private toast:ToastService,private auth:AuthService) { }

  ngOnInit() {
    this.getInfo();
  }
  getInfo() {
    this.auth.getCompanyProfile({}).subscribe(res => {
      // 保存成功返沪上一页，否则弹出提示框
      if (res.retCode == '000000') {
          this.companyProfile=res.companyProfile;
      } else if (constants.errCode[res.retCode]) {
        if (constants.errCode[res.retCode] != '0') {
          this.toast.show(constants.errCode[res.retCode]);
        }
      } else if (res.retMsg) {
        this.toast.show(res.retMsg);
      } else {
        this.toast.show("exception service routine");
      }
    });
  }
}
